import { Post } from "@/library/utils/request";
import * as types from "@/views/permession/api/types"

/**
 * 权限管理 - 接口列表 API请求路径
 */
export const ApiApiUrl = {
  SelectApis: "Rbac/SelectApi",
  InsertApi: "Rbac/InsertApi",
  DeleteApi: "Rbac/DeleteApi",
  UpdateApi: "Rbac/UpdateApi",
  BatchInsertApi: "rbac/InsertApiBatch",
  ImportApis: "Rbac/ApiIistImport",
  ExportApis: "Rbac/ApiListExport",
}

export const ApiApi = {
  /** 获取接口列表数据 */
  SelectApis: (param: types.SelectParamsType) => {
    return Post(ApiApiUrl.SelectApis, param);
  },
  /** 新增接口 */
  InsertApi: (param: types.EditDialogForm) => {
    return Post(ApiApiUrl.InsertApi, param);
  },
  /** 编辑接口 */
  UpdateApi: (param: types.EditDialogForm) => {
    return Post(ApiApiUrl.UpdateApi, param);
  },
  /** 删除接口 */
  DeleteApi: (param: { Id: number, AppId: number }) => {
    return Post(ApiApiUrl.DeleteApi, param);
  },
  /** 批量新增接口 */
  BatchInsertApi: (param: any) => {
    return Post(ApiApiUrl.BatchInsertApi, param);
  }
}